package summer_vacation.xuejiahua;

/**编写一个java应用程序,计算1+2!+3!+4!+……10! 之和
 * Created by Administrator on 2015/8/24.
 */
public class java_8
{

    public static void main(String args[])
{
    long sum=0,a=1;
    long i=1;
    while(i<=10)
    {
        if(i>=1)
            sum=sum+a;
        i++;
        a=a*i;
    }
    System.out.println("sum="+sum);
}
}
